// 封装banner相关的业务代码
import { onMounted, ref } from 'vue'
import { getBannerListAPI } from '@/apis/home'

// 轮播图数据

export const useBanner = () => {
    const banner = ref([])

    // 获取轮播图
    const getBanner = async () => {
        const res = await getBannerListAPI({
            distributionSite: '2'
        })
        // console.log(res);
        banner.value = res.result
    }
    onMounted(() => {
        getBanner()
    })

    return {
        banner
    }
}
